<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>css-dom操作</title>
    <script type="text/javascript" src="../script/jquery-3.6.0.min.js"></script>
    <script type="text/javascript">
        $(function (){
            $("#b1").click(function (){
                var width = $("img").width();
                alert("width=" + width);
                //offset
                var offset = $("img").offset();
                alert("img的 top = " + offset.top);
                alert("img的 left = " + offset.left);
            })
        })
    </script>
</head>
<body>
<br/><br/><br/>
hello,world~<img src="../image/1.png" width="200">
<button id="b1" type="button">获取图片信息</button>
</body>
</html>
